import { post,get } from "./http";
import { ResponseType } from "./utils/utils";
import apiUrl from './apiUrl'
import { loginAndRes } from "./utils/loginTpye";
// 登录
export function loginApi(phonenumber: string, smsCode: string) {
    return post<ResponseType>(apiUrl.smsLogin,{phonenumber:phonenumber,smsCode:smsCode});
 }
 // 注册
export function registerApi(obj:loginAndRes) {
    return post<ResponseType>(apiUrl.register,obj);
 }
 // 获取验证码
 export function getsms(phone:string) {
    return get<ResponseType>(apiUrl.sendSmsCode,{phone:phone});
 }
//  判断token是否过期
export function getUserAuthTypes() {
  return get<ResponseType>(apiUrl.getUserAuthTypes);
}
// 获取登录文字
export function getloginText() {
  return get<ResponseType>(apiUrl.loginconfig);
}